package com.liner;

import java.util.Scanner;

public class CommandBySwitch {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        boolean flag = true;

        System.out.println("————————欢迎来到XX银行管理系统————————");
        System.out.println("功能介绍:1.存款业务 2.取款业务 3.查询余额业务 4.退卡");
        while (flag) {
            System.out.print("请输入要操作的编号:");
            if (!scanner.hasNextInt()) {
                System.out.println("请输入数字....");
                break;
            }
            int command = scanner.nextInt();

            switch (command) {
                case 1:
                    System.out.println("存款业务....");
                    break;
                case 2:
                    System.out.println("取款业务....");
                    break;
                case 3:
                    System.out.println("查询余额业务...");
                    break;
                case 4:
                    System.out.println("退卡");
                    flag = false;
                    break;
                default:
                    System.out.println("输入错误....");
                    break;

            }
        }
    }
}
